package cn.cicoding.dao;

import cn.cicoding.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends MongoRepository<User, String> {

    /**
     * 根据名字查询分页(缺点只能是一个条件查询时使用)
     * @param name
     * @param pageable
     * @return
     */
    Page<User> findByName(String name, Pageable pageable);
}
